<!-- 司机信息完善 -->
<template>
  <view class="register-box">
    <view class="colorFA6400">
      系统提示：身份证拍照上传后可自动补全身份信息，请仔细核对
    </view>
    <u-form :model="form" ref="uForm" :label-width="290">
      <view class="card-box">
        <view class="u-flex">
          个人信息
          <view class="card-icon-box">
            <view></view>
            <view></view>
          </view>
        </view>
        <div class="u-flex top-box">
          <u-form-item class="width-50" label-position="top" label="">
            <u-upload
              :deletable="
                (auditStatus == '2' && toExamineIndexOf('身份证正面')) ||
                auditStatus === null
                  ? true
                  : false
              "
              :width="310"
              :height="190"
              class="uUpload1-box"
              ref="uUpload1"
              :action="uploadUrl1"
              @on-success="idcardFrontPhotosuccess"
              @on-remove="idcardFrontPhotoremove"
              @on-error="testerror"
              :show-progress="form.frontIdCard ? false : true"
              :upload-text="'拍摄身份证人像面'"
              max-count="1"
              :form-data="uploaderData1"
            ></u-upload>
            <image
              v-if="idcardEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 10rpx;
              "
            />
            <div
              v-if="
                idcardFrontPhotoremoveFlag &&
                form.frontIdCard &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('身份证正面')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
            </div>
          </u-form-item>
          <u-form-item class="width-50" label-position="top" label="">
            <u-upload
              :deletable="
                (auditStatus == '2' && toExamineIndexOf('身份证反面')) ||
                auditStatus === null
                  ? true
                  : false
              "
              :width="310"
              :height="190"
              class="uUpload2-box"
              ref="uUpload2"
              :action="uploadUrl1"
              @on-success="idcardBackPhotosuccess"
              @on-remove="idcardBackPhotoremove"
              @on-error="testerror"
              :show-progress="form.backIdCard ? false : true"
              :upload-text="'拍摄身份证国徽面'"
              max-count="1"
              :form-data="uploaderData2"
            ></u-upload>
            <image
              v-if="idcardBackEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 10rpx;
              "
            />
            <div
              v-if="
                idcardBackPhotoremoveFlag &&
                form.backIdCard &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('身份证反面')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
            </div>
          </u-form-item>
        </div>
        <u-form-item
          label="姓名"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('身份证正面')
                ? true
                : false
            "
            v-model="form.fullName"
            placeholder="请输入姓名"
          />
        </u-form-item>
        <u-form-item
          ref="idCardCode"
          prop="idCardCode"
          label="身份证号"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('身份证正面')
                ? true
                : false
            "
            v-model="form.idCardCode"
            :maxlength="18"
            placeholder="请填写身份证号"
            @on-blur="upperCase"
          />
        </u-form-item>
        <u-form-item
          ref="expirationDate"
          prop="expirationDate"
          label="到期日期"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('身份证反面')
                ? true
                : false
            "
            type="select"
            v-model="form.expirationDate"
            :maxlength="18"
            @click="expirationDateShow = true"
            placeholder="请填写到期日期"
          />
          <u-picker
            v-model="expirationDateShow"
            mode="time"
            @confirm="handleExpirationDateConfirm"
            :default-time="form.expirationDate"
            :show-time-tag="false"
          ></u-picker>
        </u-form-item>
      </view>
      <view class="card-box">
        <view class="u-flex">
          公司信息<view class="card-icon-box">
            <view></view>
            <view></view>
          </view>
        </view>
        <div class="u-flex top-box">
          <u-form-item class="width-50" label-position="top" label="">
            <u-upload
              :deletable="
                (auditStatus == '2' && toExamineIndexOf('法人身份证')) ||
                auditStatus === null
                  ? true
                  : false
              "
              :width="310"
              :height="190"
              class="uUpload1-box"
              ref="uUpload3"
              :action="uploadUrl1"
              @on-success="legalPersonIdCardsuccess"
              @on-remove="legalPersonIdCardmove"
              @on-error="testerror"
              :show-progress="form.legalPersonIdCard ? false : true"
              :upload-text="'拍摄法人身份证'"
              max-count="1"
              :form-data="uploaderData1"
            ></u-upload>
            <image
              v-if="legalPersonIdCardEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 10rpx;
              "
            />
            <div
              v-if="
                idcardFrontPhotoremoveFlag &&
                form.legalPersonIdCard &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('法人身份证')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
            </div>
          </u-form-item>
          <u-form-item class="width-50" label-position="top" label="">
            <u-upload
              :deletable="
                (auditStatus == '2' && toExamineIndexOf('营业执照')) ||
                auditStatus === null
                  ? true
                  : false
              "
              :width="310"
              :height="190"
              class="uUpload2-box"
              ref="uUpload4"
              :action="uploadUrl2"
              @on-success="businessLicensesuccess"
              @on-remove="businessLicensemove"
              @on-error="testerror"
              :show-progress="form.businessLicense ? false : true"
              :upload-text="'拍摄营业执照'"
              max-count="1"
              :form-data="certificateNouploaderData"
            ></u-upload>
            <image
              v-if="businessLicenseEditable"
              :src="uploadIconList[0].icon"
              style="
                width: 40rpx;
                height: 40rpx;
                display: inline;
                position: absolute;
                bottom: 30rpx;
                right: 10rpx;
              "
            />
            <div
              v-if="
                idcardBackPhotoremoveFlag &&
                form.businessLicense &&
                auditStatus != null &&
                auditStatus != '0'
              "
              class="toexamine-box"
            >
              <div v-if="!toExamineIndexOf('营业执照')">
                <image
                  :src="uploadIconList[1].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
              <div v-else>
                <image
                  :src="uploadIconList[2].icon"
                  style="
                    width: 120rpx;
                    height: 120rpx;
                    display: inline;
                    position: absolute;
                    bottom: 70rpx;
                    left: 0;
                  "
                />
              </div>
            </div>
          </u-form-item>
        </div>
        <u-form-item
          label="企业名称"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('营业执照')
                ? true
                : false
            "
            v-model="form.corporateName"
            placeholder="请输入企业名称"
          />
        </u-form-item>
        <u-form-item
          ref="creditCode"
          prop="creditCode"
          label="信用代码"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('营业执照')
                ? true
                : false
            "
            v-model="form.creditCode"
            :maxlength="18"
            placeholder="请填写信用代码"
            @on-blur="upperCase"
          />
        </u-form-item>
        <u-form-item
          ref="legalPersonName"
          prop="legalPersonName"
          label="法人姓名"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('法人身份证')
                ? true
                : false
            "
            v-model="form.legalPersonName"
            :maxlength="18"
            placeholder="请填写法人姓名"
            @on-blur="upperCase"
          />
        </u-form-item>
        <u-form-item
          ref="corporateIdNumber"
          prop="corporateIdNumber"
          label="法人身份证号"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('法人身份证')
                ? true
                : false
            "
            v-model="form.corporateIdNumber"
            :maxlength="18"
            placeholder="请填写法人身份证号"
            @on-blur="upperCase"
          />
        </u-form-item>
        <u-form-item
          ref="companyAddress"
          prop="companyAddress"
          label="公司地址"
          left-icon="star-fill"
          :left-icon-style="{
            color: 'red',
            fontsize: '18rpx',
          }"
        >
          <u-input
            :disabled="
              auditStatus != null && !toExamineIndexOf('营业执照')
                ? true
                : false
            "
            v-model="form.companyAddress"
            :maxlength="18"
            placeholder="请填写公司地址"
            @on-blur="upperCase"
          />
        </u-form-item>
      </view>
    </u-form>
    <u-button
      v-if="auditStatus == null || auditStatus == '2'"
      type="primary"
      @click="submit"
      class="vehiclemanagement-index-btn"
      style="margin: 50rpx 0 10rpx 0"
    >
      提交
    </u-button>
    <u-modal
      v-model="showModal"
      :width="'560'"
      :show-title="false"
      :showConfirmButton="false"
    >
      <view style="padding: 30rpx">
        <view
          style="
            font-weight: bold;
            padding: 10rpx 0 0 20rpx;
            text-align: center;
          "
          >信息确认
        </view>
      </view>
      <view class="modal-content">
        <view class="section">
          <view class="title">
            <view class="title-text">个人信息</view>
            <image src="../../static/title-icon.png" class="title-icon" />
          </view>
          <view class="content">
            <view class="item">
              <view class="item-name">姓名：</view>
              <view class="item-desc">{{ submitObj.fullName }}</view>
            </view>
            <view class="item">
              <view class="item-name">身份证号：</view>
              <view class="item-desc">{{ submitObj.idCardCode }}</view>
            </view>
            <view class="item">
              <view class="item-name">到期时间：</view>
              <view class="item-desc">{{ submitObj.expirationDate }}</view>
            </view>
          </view>
        </view>
        <view class="section">
          <view class="title">
            <view class="title-text">公司信息</view>
            <image src="../../static/title-icon.png" class="title-icon" />
          </view>
          <view class="content">
            <view class="item">
              <view class="item-name">公司名称：</view>
              <view class="item-desc">{{ submitObj.corporateName }}</view>
            </view>
            <view class="item">
              <view class="item-name">信用代码：</view>
              <view class="item-desc">{{ submitObj.creditCode }}</view>
            </view>
            <view class="item">
              <view class="item-name">法人姓名：</view>
              <view class="item-desc">{{ submitObj.legalPersonName }}</view>
            </view>
            <view class="item">
              <view class="item-name">身份证号：</view>
              <view class="item-desc">{{ submitObj.corporateIdNumber }}</view>
            </view>
            <view class="item">
              <view class="item-name">公司地址：</view>
              <view class="item-desc">{{ submitObj.companyAddress }}</view>
            </view>
          </view>
        </view>
      </view>
      <view
        style="
          display: flex;
          justify-content: space-around;
          padding-bottom: 20rpx;
        "
      >
        <u-button
          type="primary"
          shape="circle"
          plain
          style="width: 224rpx"
          @click="handleCancel"
          >取 消
        </u-button>
        <u-button
          type="primary"
          shape="circle"
          :disabled="confirmTime > 0"
          style="width: 224rpx"
          @click="handleConfirm"
        >
          确 定 {{ confirmTime > 0 ? confirmTime + 's' : '' }}
        </u-button>
      </view>
    </u-modal>
  </view>
</template>
<script>
import httpEnum from '../../common/httpEnum.js'
export default {
  data() {
    return {
      expirationDateShow: false,
      confirmTime: 6,
      showModal: false,
      idcardEditable: false,
      idcardBackEditable: false,
      legalPersonIdCardEditable: false,
      businessLicenseEditable: false,
      userInfo: {},
      getCodeDisabled: false,
      auditStatus: null,
      show: true,
      count: '',
      timer: null,
      uploadUrl:
        httpEnum.baseUploadUrl +
        '/freight-business/ocr/recognize/drivingLicense',
      uploaderData: {
        bucketName: 'app',
        folderName: 'drivingLicense',
      },
      uploadUrl1:
        httpEnum.baseUploadUrl + '/freight-business/ocr/recognize/idcard',
      uploadUrl2: httpEnum.baseUploadUrl + '/freight-business/file/app/upload',
      uploaderData1: {
        bucketName: 'logistics-control-platform',
        folderName: 'shipperPic',
        type: 'face',
      },
      uploaderData2: {
        bucketName: 'logistics-control-platform',
        folderName: 'shipperPic',
        type: 'back',
      },
      certificateNouploaderData: {
        bucketName: 'logistics-control-platform',
        folderName: 'shipperPic',
      },
      fleetNameShow: false,
      fleetNamelist: [],
      form: {
        id: undefined,
        frontIdCard: undefined, //身份证正面
        backIdCard: undefined, //身份证反面
        fullName: undefined, //姓名
        idCardCode: undefined, //身份证号
        expirationDate: undefined, //到期日期
        legalPersonIdCard: undefined, //法人身份证
        creditCode: undefined, // 信用代码
        legalPersonName: undefined, // 法人姓名
        corporateIdNumber: undefined, //法人身份证号
        companyAddress: undefined, //公司地址
        corporateName: undefined, //公司名称
        businessLicense: undefined, //营业执照
      },
      rules: {
        // driverName: [
        //   {
        //     required: true,
        //     message: '请填写司机姓名',
        //     trigger: ['change', 'blur'],
        //   },
        // ],
        phone: [
          {
            required: true,
            message: '请填写手机号',
            trigger: ['change', 'blur'],
          },
          {
            // 自定义验证函数，见上说明
            validator: (rule, value, callback) => {
              // 上面有说，返回true表示校验通过，返回false表示不通过
              // this.$u.test.mobile()就是返回true或者false的
              return this.$u.test.mobile(value)
            },
            message: '手机号码不正确',
            // 触发器可以同时用blur和change
            trigger: ['change', 'blur'],
          },
        ],
        verificationCode: [
          {
            required: true,
            message: '请输入验证码',
            trigger: ['change', 'blur'],
          },
        ],
        frontIdCard: [
          {
            required: true,
            message: '身份证号码不能为空',
            trigger: 'blur',
          },
          {
            type: 'string',
            pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
            message: '请输入正确的身份证号',
            trigger: ['change', 'blur'],
          },
        ],
      },
      maxSize: 1024 * 1024 * 4,
      deletableTextList: [], //数组
      ids: undefined,
      idcardFrontPhotoremoveFlag: true, //身份证正面删除标识
      idcardBackPhotoremoveFlag: true, //身份证反面删除标识
      legalPersonIdCardFlag: true, //法人身份证删除标识
      businessLicensemoveFlag: true, //营业执照删除标识
      uploadIconList: [
        {
          icon: 'https://minio.wskjwl.com/uipicture/correcticon.png',
          path: '/pages/vehiclemanagement/vehiclemanagement',
          title: '完成标识',
        },
        {
          icon: 'https://minio.wskjwl.com/uipicture/uploadpass.png',
          path: '/pages/login/register',
          title: '审核通过',
        },
        {
          icon: 'https://minio.wskjwl.com/uipicture/uploadreject.png',
          path: '/pages/login/register',
          title: '审核失败',
        },
      ],
      submitObj: {},
      timer: null,
    }
  },
  mounted() {
    this.getDertailData()
    // this.getFleetNameData()
  },
  // 必须要在onReady生命周期，因为onLoad生命周期组件可能尚未创建完毕
  onReady() {
    this.$refs.uForm.setRules(this.rules)
  },
  onShow() {
    // this.getDertailData()
  },
  watch: {
    'form.idCardCode'(val, old) {
      this.upperCase(val)
    },
  },
  methods: {
    handleExpirationDateConfirm(val) {
      this.form.expirationDate = val.year + '-' + val.month + '-' + val.day
    },
    //触发校验
    triggerSingleFieldValidate(refName) {
      this.$refs[refName].onFieldChange()
    },
    //审核存在判断
    toExamineIndexOf(val) {
      let tagFlag = undefined
      if (this.deletableTextList.indexOf(val) == -1) {
        tagFlag = false
      } else {
        tagFlag = true
      }
      return tagFlag
    },
    //字符串中小写转大写
    upperCase(str) {
      let arr = str.split('')
      let newStr = ''
      // 通过数组的forEach方法来遍历数组
      arr.forEach(function (value) {
        if (value >= 'a' && value <= 'z') newStr += value.toUpperCase()
        else newStr += value
      })
      this.form.idcard = newStr
    },
    //获取验证码
    getCode() {
      if (this.form.phone) {
        const intime = 60
        if (!this.timer) {
          this.count = intime
          this.show = false
          this.getCodeDisabled = true
          this.timer = setInterval(() => {
            if (this.count > 0 && this.count <= intime) {
              this.count--
            } else {
              this.show = true
              this.getCodeDisabled = false
              clearInterval(this.timer)
              this.timer = null
            }
          }, 1000)
          this.getCodeData({
            type: '1',
            iphone: this.form.phone,
          })
        }
      } else {
        this.$api.msg('请先输入手机号码')
      }
    },
    // 发送短信验证码
    async getCodeData(val) {
      const { code, result, message } = await this.$u.post(
        '/freight-auth/client/smsSend',
        val
      )
      if (code === '0') {
        this.$api.msg('短信验证已发送')
      } else {
        this.$api.msg(message)
      }
    },
    //车型选择
    fleetNameconfirm(val) {
      this.form.fleetName = val[0].label
      this.form.fleetId = val[0].value
    },
    //身份证正面
    idcardFrontPhotosuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.fullName = data.result.name
        this.form.idCardCode = data.result.idNumber
        this.form.frontIdCard = data.result.imgUrl
        this.triggerSingleFieldValidate('idCardCode')
        this.idcardEditable = true
      } else {
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
        this.$refs.uUpload1.lists = []
      }
    },
    //身份证正面移除
    idcardFrontPhotoremove() {
      this.form.frontIdCard = undefined
      this.idcardFrontPhotoremoveFlag = false
      this.idcardEditable = false
    },
    //身份证反面
    idcardBackPhotosuccess(data, index, lists, name) {
      if (data.code == '0') {
        const search = '.'
        const replaceWith = '-'
        this.form.backIdCard = data.result.imgUrl
        this.form.expirationDate = data.result.validPeriod
          .substring(11)
          .split(search)
          .join(replaceWith)
        this.idcardBackEditable = true
      } else {
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
        this.$refs.uUpload2.lists = []
      }
    },
    //身份证反面移除
    idcardBackPhotoremove() {
      this.form.idcardBackPhoto = undefined
      this.idcardBackPhotoremoveFlag = false
      this.idcardBackEditable = false
    },
    //上传失败
    testerror(res, index, lists, name) {
      this.$api.msg('上传失败')
    },
    //法人身份证	上传成功
    legalPersonIdCardsuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.legalPersonIdCard = data.result.imgUrl
        this.form.legalPersonName = data.result.name
        this.form.corporateIdNumber = data.result.idNumber
        this.legalPersonIdCardEditable = true
      } else {
        this.form.legalPersonIdCard = ''
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
      }
    },
    //法人身份证移除
    legalPersonIdCardmove() {
      this.form.legalPersonIdCard = undefined
      this.legalPersonIdCardmoveFlag = false
      this.legalPersonIdCardEditable = false
    },
    // 营业执照上传
    businessLicensesuccess(data, index, lists, name) {
      if (data.code == '0') {
        this.form.businessLicense = data.result
        this.businessLicenseEditable = true
      } else {
        setTimeout(() => {
          this.$api.msg(data.message)
        }, 200)
        this.$refs.uUpload3.lists = []
      }
    },
    //营业执照移除
    businessLicensemove() {
      this.form.businessLicense = undefined
      this.businessLicensemoveFlag = false
      this.businessLicenseEditable = false
    },
    //提交
    submit() {
      this.$refs.uForm.validate((valid) => {
        if (valid) {
          if (this.form.fullName && this.form.frontIdCard) {
            this.postData(this.form)
          } else {
            this.$api.msg('请填写相关信息')
          }
        } else {
          this.$api.msg('请填写相关信息')
        }
      })
    },
    // 提交数据
    postData(data) {
      let photoList = [
        'frontIdCard',
        'backIdCard',
        'legalPersonIdCard',
        'businessLicense',
      ]
      let tagShow = true
      photoList.forEach((item) => {
        if (!data[item] || data[item] == undefined) {
          tagShow = false
        }
      })
      let obj = {
        ...data,
      }
      this.submitObj = obj
      if (tagShow) {
        this.getuserInfo()
      } else {
        this.$api.msg('部分图片未上传或上传图片有误')
      }
    },
    // 注册提交
    async submitData(val) {
      const { code, result, message } = await this.$u.post(
        '/freight-business/logisticsCargoOwner/add',
        val
      )
      if (code === '0') {
        this.$api.msg('提交成功')
        setTimeout(() => {
          uni.navigateBack()
        }, 2000)
      } else {
        this.$api.msg(message)
      }
    },
    // 注册提交
    async submitEditData(val) {
      const { code, result, message } = await this.$u.put(
        '/freight-business/logisticsCargoOwner/update',
        val
      )
      if (code === '0') {
        this.$api.msg('信息完善成功')
        setTimeout(() => {
          uni.navigateBack()
        }, 2000)
      } else {
        this.$api.msg(message)
      }
    },
    getuserInfo() {
      this.showModal = true
      this.timer = setInterval(() => {
        this.confirmTime--
        if (this.confirmTime < 1) {
          clearInterval(this.timer)
        }
      }, 1000)
    },
    handleConfirm() {
      this.showModal = false
      this.confirmTime = 6
      if (this.authStatus == '1') {
        this.submitEditData(this.submitObj)
      } else {
        this.submitData(this.submitObj)
      }
    },
    handleCancel() {
      this.showModal = false
      this.confirmTime = 6
      clearInterval(this.timer)
    },
    // 请求详情数据
    async getDertailData() {
      const { code, result, message } = await this.$u.get(
        '/freight-business/logisticsCargoOwner/getByLoginUserId'
      )
      if (code === '0') {
        if (result) {
          this.auditStatus = result.auditStatus
          this.deletableTextList =
            result.rejectDocuments && JSON.parse(result.rejectDocuments)
          this.form.frontIdCard = result.frontIdCard
          this.form.backIdCard = result.backIdCard
          this.form.fullName = result.fullName
          this.form.idCardCode = result.idCardCode
          this.form.expirationDate = result.expirationDate
          this.form.legalPersonIdCard = result.legalPersonIdCard
          this.form.creditCode = result.creditCode
          this.form.legalPersonName = result.legalPersonName
          this.form.corporateIdNumber = result.corporateIdNumber
          this.form.companyAddress = result.companyAddress
          this.form.cargoOwnerPhone = result.cargoOwnerPhone
          this.form.corporateName = result.corporateName
          this.form.businessLicense = result.businessLicense
          this.form.id = result.id
          this.$refs.uUpload4.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/freight-control-platform/' +
                result.businessLicense,
            },
          ]
          this.$refs.uUpload3.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/freight-control-platform/' +
                result.legalPersonIdCard,
            },
          ]
          this.$refs.uUpload2.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/freight-control-platform/' +
                result.backIdCard,
            },
          ]
          this.$refs.uUpload1.lists = [
            {
              url:
                httpEnum.baseImgUrl +
                '/freight-control-platform/' +
                result.frontIdCard,
            },
          ]
        }
      } else {
        this.$api.msg(message)
      }
    },
  },
}
</script>
<style lang="scss" scoped>
.register-box {
  background-color: rgb(238, 238, 239);
  padding: 8rpx 24rpx 16rpx;
  .colorFA6400 {
    color: #fa6400;
    font-size: 24rpx;
  }
  .top-box {
    .width-50 {
      flex: 1;
      position: relative;
      .toexamine-box {
        position: absolute;
        bottom: 30rpx;
        left: 10rpx;
        color: white;
        width: 50rpx;
        height: 50rpx;
        border-radius: 50%;
        font-size: 18rpx;
        display: flex;
        flex-direction: column;
        align-items: center;
        line-height: 22rpx;
      }
    }
  }

  .width-100 {
    position: relative;
    .toexamine-box {
      position: absolute;
      bottom: 30rpx;
      right: 300rpx;
      color: white;
      width: 50rpx;
      height: 50rpx;
      border-radius: 50%;
      font-size: 18rpx;
      display: flex;
      flex-direction: column;
      align-items: center;
      line-height: 22rpx;
    }
  }
  .row-box {
    display: flex;
    margin-right: 16rpx;
  }
  .getCode-box {
    width: 100rpx;
  }
  .card-box {
    background: white;
    margin-top: 24rpx;
    border-radius: 10rpx;
    padding: 24rpx 24rpx 0;
    .card-title-box {
      font-size: 28rpx;
      font-weight: 600;
    }
    .card-icon-box {
      margin-left: 6rpx;
      position: relative;
      view:nth-child(1) {
        width: 20rpx;
        height: 20rpx;
        border-radius: 50%;
        background: #57a3ff;
        position: absolute;
        top: -12rpx;
        left: 10rpx;
        z-index: 1;
      }
      view:nth-child(2) {
        width: 20rpx;
        height: 20rpx;
        border-radius: 50%;
        background: #add3ff;
        position: absolute;
        top: -6rpx;
        left: 20rpx;
      }
    }
  }
  .uUpload1-box {
    /deep/.u-list-item {
      // background-image: url('https://minio.wskjwl.com/uipicture/shenfenzhengzheng.png');
      background-image: url('../../static/end.png');
      background-size: 50% 50%;
      background-position: center;
      background-repeat: no-repeat;
    }
  }
  .uUpload2-box {
    /deep/.u-list-item {
      // background-image: url('https://minio.wskjwl.com/uipicture/shenfenzheng2.png');
      background-image: url('../../static/front.png');
      background-size: 50% 50%;
      background-position: center;
      background-repeat: no-repeat;
    }
  }
  /deep/.u-add-tips[data-v-0d33af60] {
    margin-top: 150rpx;
  }
  /deep/.u-iconfont[data-v-6e20bb40]::before {
    display: none;
  }
}
.modal-content {
  padding: 0 30rpx;
  .title {
    display: flex;
    align-items: center;
    margin-bottom: 24rpx;
    &-text {
      font-size: 28rpx;
      font-weight: 500;
      color: #000000;
      line-height: 40rpx;
    }
    &-icon {
      width: 27rpx;
      height: 25rpx;
      margin-left: 4rpx;
    }
  }
  .section {
    margin-bottom: 32rpx;
  }
  .item {
    display: flex;
    font-size: 28rpx;
    color: #333333;
    line-height: 40rpx;
    &-name {
      white-space: nowrap;
    }
  }
}
</style>
